package com.lin.order;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 启动类
 */
@SpringBootApplication
@EntityScan("com.lin.order.entity")
@EnableEurekaClient
public class OrderApplication {
    /**
     * 使用spring提供的RestTemplate
     * 1.创建一个bean
     * 2.调用其方法发送http请求
     * @return
     */
    @LoadBalanced  //是ribbon提供的负载均衡的注解
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class,args);
    }
}
